package site.jlopen.kuscia.errorcode;

 
public enum DatasourceErrorCode implements ErrorCode {
    DATA_SOURCE_ENDPOINT_CONNECT_FAIL(202012501),

    DATA_SOURCE_CREATE_FAIL(202012502),
    DATA_SOURCE_BUCKET_NOT_EXIST(202012503),
    DATA_SOURCE_CREDENTIALS_INVALID(202012504),
    DATA_SOURCE_BUCKET_NOT_MATCH_ENDPOINT(202012506),

    DATA_SOURCE_ENDPOINT_API_PORT_ERROR(202012507),

    DATASOURCE_UNKNOWN_EXCEPTION(202012508),

    DATA_SOURCE_DELETE_FAIL(202012509),

    /**
     * Failed to query the data source
     */
    QUERY_DATASOURCE_FAILED(202012505),
    ;


    private final int code;

    DatasourceErrorCode(int code) {
        this.code = code;
    }

    @Override
    public String getMessageKey() {
        return "datasource." + this.name();
    }

    @Override
    public Integer getCode() {
        return code;
    }
}
